home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / perl5 / File::Path.z / File::Path
Encoding:
Text File  |  2002-10-03  |  3.7 KB  |  133 lines

  1.  
  2.  
  3.  
  4. FFFFiiiilllleeee::::::::PPPPaaaatttthhhh((((3333))))                                                    FFFFiiiilllleeee::::::::PPPPaaaatttthhhh((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      File::Path - create or remove a series of directories
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      use File::Path
  13.  
  14.      mkpath(['/foo/bar/baz', 'blurfl/quux'], 1, 0711);
  15.  
  16.      rmtree(['foo/bar/baz', 'blurfl/quux'], 1, 1);
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      The mkpath function provides a convenient way to create directories, even
  20.      if your mkdir kernel call won't create more than one level of directory
  21.      at a time.  mkpath takes three arguments:
  22.  
  23.      +o   the name of the path to create, or a reference to a list of paths to
  24.          create,
  25.  
  26.      +o   a boolean value, which if TRUE will cause mkpath to print the name of
  27.          each directory as it is created (defaults to FALSE), and
  28.  
  29.      +o   the numeric mode to use when creating the directories (defaults to
  30.          0777)
  31.  
  32.      It returns a list of all directories (including intermediates, determined
  33.      using the Unix '/' separator) created.
  34.  
  35.      Similarly, the rmtree function provides a convenient way to delete a
  36.      subtree from the directory structure, much like the Unix command rm -r.
  37.      rmtree takes three arguments:
  38.  
  39.      +o   the root of the subtree to delete, or a reference to a list of roots.
  40.          All of the files and directories below each root, as well as the
  41.          roots themselves, will be deleted.
  42.  
  43.      +o   a boolean value, which if TRUE will cause rmtree to print a message
  44.          each time it examines a file, giving the name of the file, and
  45.          indicating whether it's using rmdir or unlink to remove it, or that
  46.          it's skipping it.  (defaults to FALSE)
  47.  
  48.      +o   a boolean value, which if TRUE will cause rmtree to skip any files to
  49.          which you do not have delete access (if running under VMS) or write
  50.          access (if running under another OS).  This will change in the future
  51.          when a criterion for 'delete permission' under OSs other than VMS is
  52.          settled.  (defaults to FALSE)
  53.  
  54.      It returns the number of files successfully deleted.  Symlinks are
  55.      treated as ordinary files.
  56.  
  57.      NNNNOOOOTTTTEEEE:::: If the third parameter is not TRUE, rmtree is uuuunnnnsssseeeeccccuuuurrrreeee in the face
  58.      of failure or interruption.  Files and directories which were not deleted
  59.      may be left with permissions reset to allow world read and write access.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. FFFFiiiilllleeee::::::::PPPPaaaatttthhhh((((3333))))                                                    FFFFiiiilllleeee::::::::PPPPaaaatttthhhh((((3333))))
  71.  
  72.  
  73.  
  74.      Note also that the occurrence of errors in rmtree can be determined _o_n_l_y
  75.      by trapping diagnostic messages using $SIG{__WARN__}; it is not apparent
  76.      from the return value.  Therefore, you must be extremely careful about
  77.      using rmtree($foo,$bar,0 in situations where security is an issue.
  78.  
  79. AAAAUUUUTTTTHHHHOOOORRRRSSSS
  80.      Tim Bunce <_T_i_m._B_u_n_c_e@_i_g._c_o._u_k> and Charles Bailey
  81.      <_b_a_i_l_e_y@_n_e_w_m_a_n._u_p_e_n_n._e_d_u>
  82.  
  83. RRRREEEEVVVVIIIISSSSIIIIOOOONNNN
  84.      Current $VERSION is 1.0401.
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.